<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>41-深拷贝-lodash库实现</title>
</head>
<body>
    <!-- 引入lodash库 -->
    <script src="../js/lodash.min.js"></script>
    <script>
        const obj = {
            name:'周思涵',
            love: undefined,
            family:{
                father:'周爸爸'
            },
            hobby:['打游戏','睡觉'],
            sayHi() {
                console.log('我会飞')
            }
        }
        // lodash 库 实现 深拷贝
        const newObj = _.cloneDeep(obj)

        // console.log(obj)
        // console.log(newObj)

        newObj.family.father = '周父'
        console.log(obj)
        console.log(newObj)
        

    </script>
</body>
</html>